<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import = "quiz.Account" %>
<%
	boolean adminRequired = false;
	if (request.getParameter("admin_only") != null)
		adminRequired = Boolean.parseBoolean(request.getParameter("admin_only"));

	Account myAcct = (Account)session.getAttribute("account");
	if (myAcct == null) {
		request.setAttribute("error", "Sorry, we only allow people we know to quiz on that page");
		pageContext.forward("login.jsp");
	}
	if (adminRequired && !myAcct.isAdmin()) {
		request.setAttribute("error", "Sorry, only important people can quiz on that page");
		pageContext.forward("login.jsp");
	}
%>